3.1.53 \(\int \csc ^4(e+f x) (a+b \tan ^2(e+f x))^2 \, dx\) [53]

Optimal. Leaf size=70 \[ -\frac {a (a+2 b) \cot (e+f x)}{f}-\frac {a^2 \cot ^3(e+f x)}{3 f}+\frac {b (2 a+b) \tan (e+f x)}{f}+\frac {b^2 \tan ^3(e+f x)}{3 f} \]

[Out]

-a*(a+2*b)*cot(f*x+e)/f-1/3*a^2*cot(f*x+e)^3/f+b*(2*a+b)*tan(f*x+e)/f+1/3*b^2*tan(f*x+e)^3/f

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 70, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {3744, 459} \begin {gather*} -\frac {a^2 \cot ^3(e+f x)}{3 f}+\frac {b (2 a+b) \tan (e+f x)}{f}-\frac {a (a+2 b) \cot (e+f x)}{f}+\frac {b^2 \tan ^3(e+f x)}{3 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^4*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-((a*(a + 2*b)*Cot[e + f*x])/f) - (a^2*Cot[e + f*x]^3)/(3*f) + (b*(2*a + b)*Tan[e + f*x])/f + (b^2*Tan[e + f*x
]^3)/(3*f)

Rule 459

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[ExpandI
ntegrand[(e*x)^m*(a + b*x^n)^p*(c + d*x^n)^q, x], x] /; FreeQ[{a, b, c, d, e, m, n}, x] && NeQ[b*c - a*d, 0] &
& IGtQ[p, 0] && IGtQ[q, 0]

Rule 3744

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff^(m + 1)/f), Subst[Int[x^m*((a + b*(ff*x)^n)^p/(c^2 + ff^2*x^2)
^(m/2 + 1)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2]

Rubi steps

\begin {align*} \int \csc ^4(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac {\text {Subst}\left (\int \frac {\left (1+x^2\right ) \left (a+b x^2\right )^2}{x^4} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\text {Subst}\left (\int \left (b (2 a+b)+\frac {a^2}{x^4}+\frac {a (a+2 b)}{x^2}+b^2 x^2\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {a (a+2 b) \cot (e+f x)}{f}-\frac {a^2 \cot ^3(e+f x)}{3 f}+\frac {b (2 a+b) \tan (e+f x)}{f}+\frac {b^2 \tan ^3(e+f x)}{3 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.33, size = 59, normalized size = 0.84 \begin {gather*} \frac {-a \cot (e+f x) \left (2 a+6 b+a \csc ^2(e+f x)\right )+b \left (6 a+2 b+b \sec ^2(e+f x)\right ) \tan (e+f x)}{3 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]^4*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

(-(a*Cot[e + f*x]*(2*a + 6*b + a*Csc[e + f*x]^2)) + b*(6*a + 2*b + b*Sec[e + f*x]^2)*Tan[e + f*x])/(3*f)

________________________________________________________________________________________

Maple [A]
time = 0.15, size = 81, normalized size = 1.16

method result size
derivativedivides \(\frac {-b^{2} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (f x +e \right )\right )}{3}\right ) \tan \left (f x +e \right )+2 a b \left (\frac {1}{\sin \left (f x +e \right ) \cos \left (f x +e \right )}-2 \cot \left (f x +e \right )\right )+a^{2} \left (-\frac {2}{3}-\frac {\left (\csc ^{2}\left (f x +e \right )\right )}{3}\right ) \cot \left (f x +e \right )}{f}\) \(81\)
default \(\frac {-b^{2} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (f x +e \right )\right )}{3}\right ) \tan \left (f x +e \right )+2 a b \left (\frac {1}{\sin \left (f x +e \right ) \cos \left (f x +e \right )}-2 \cot \left (f x +e \right )\right )+a^{2} \left (-\frac {2}{3}-\frac {\left (\csc ^{2}\left (f x +e \right )\right )}{3}\right ) \cot \left (f x +e \right )}{f}\) \(81\)
risch \(\frac {4 i \left (3 a^{2} {\mathrm e}^{8 i \left (f x +e \right )}-6 a b \,{\mathrm e}^{8 i \left (f x +e \right )}+3 b^{2} {\mathrm e}^{8 i \left (f x +e \right )}+8 a^{2} {\mathrm e}^{6 i \left (f x +e \right )}-8 b^{2} {\mathrm e}^{6 i \left (f x +e \right )}+6 a^{2} {\mathrm e}^{4 i \left (f x +e \right )}+12 a b \,{\mathrm e}^{4 i \left (f x +e \right )}+6 b^{2} {\mathrm e}^{4 i \left (f x +e \right )}-a^{2}-6 a b -b^{2}\right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{3} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}\) \(158\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^4*(a+b*tan(f*x+e)^2)^2,x,method=_RETURNVERBOSE)

[Out]

1/f*(-b^2*(-2/3-1/3*sec(f*x+e)^2)*tan(f*x+e)+2*a*b*(1/sin(f*x+e)/cos(f*x+e)-2*cot(f*x+e))+a^2*(-2/3-1/3*csc(f*
x+e)^2)*cot(f*x+e))

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 70, normalized size = 1.00 \begin {gather*} \frac {b^{2} \tan \left (f x + e\right )^{3} + 3 \, {\left (2 \, a b + b^{2}\right )} \tan \left (f x + e\right ) - \frac {3 \, {\left (a^{2} + 2 \, a b\right )} \tan \left (f x + e\right )^{2} + a^{2}}{\tan \left (f x + e\right )^{3}}}{3 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^4*(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/3*(b^2*tan(f*x + e)^3 + 3*(2*a*b + b^2)*tan(f*x + e) - (3*(a^2 + 2*a*b)*tan(f*x + e)^2 + a^2)/tan(f*x + e)^3
)/f

________________________________________________________________________________________

Fricas [A]
time = 1.09, size = 98, normalized size = 1.40 \begin {gather*} -\frac {2 \, {\left (a^{2} + 6 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{6} - 3 \, {\left (a^{2} + 6 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{4} + 6 \, a b \cos \left (f x + e\right )^{2} + b^{2}}{3 \, {\left (f \cos \left (f x + e\right )^{5} - f \cos \left (f x + e\right )^{3}\right )} \sin \left (f x + e\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^4*(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

-1/3*(2*(a^2 + 6*a*b + b^2)*cos(f*x + e)^6 - 3*(a^2 + 6*a*b + b^2)*cos(f*x + e)^4 + 6*a*b*cos(f*x + e)^2 + b^2
)/((f*cos(f*x + e)^5 - f*cos(f*x + e)^3)*sin(f*x + e))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{2} \csc ^{4}{\left (e + f x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**4*(a+b*tan(f*x+e)**2)**2,x)

[Out]

Integral((a + b*tan(e + f*x)**2)**2*csc(e + f*x)**4, x)

________________________________________________________________________________________

Giac [A]
time = 0.81, size = 84, normalized size = 1.20 \begin {gather*} \frac {b^{2} \tan \left (f x + e\right )^{3} + 6 \, a b \tan \left (f x + e\right ) + 3 \, b^{2} \tan \left (f x + e\right ) - \frac {3 \, a^{2} \tan \left (f x + e\right )^{2} + 6 \, a b \tan \left (f x + e\right )^{2} + a^{2}}{\tan \left (f x + e\right )^{3}}}{3 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^4*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/3*(b^2*tan(f*x + e)^3 + 6*a*b*tan(f*x + e) + 3*b^2*tan(f*x + e) - (3*a^2*tan(f*x + e)^2 + 6*a*b*tan(f*x + e)
^2 + a^2)/tan(f*x + e)^3)/f

________________________________________________________________________________________

Mupad [B]
time = 11.82, size = 69, normalized size = 0.99 \begin {gather*} \frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3\,f}-\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (a^2+2\,b\,a\right )+\frac {a^2}{3}}{f\,{\mathrm {tan}\left (e+f\,x\right )}^3}+\frac {b\,\mathrm {tan}\left (e+f\,x\right )\,\left (2\,a+b\right )}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(e + f*x)^2)^2/sin(e + f*x)^4,x)

[Out]

(b^2*tan(e + f*x)^3)/(3*f) - (tan(e + f*x)^2*(2*a*b + a^2) + a^2/3)/(f*tan(e + f*x)^3) + (b*tan(e + f*x)*(2*a
+ b))/f

________________________________________________________________________________________